package com.wyp168.juc;

/**
 * @ClassName DaemonDemo001
 * @Description TODO
 * @Author wyp168
 * @Date 2022/9/4 09:30
 */
public class DaemonDemo001 {
    public static void main(String[] args) {
        Thread diyThread = new Thread(() -> {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName() + ":-->" + Thread.currentThread().isDaemon());
            while (true) {

            }
        }, "DiyThread");
        diyThread.setDaemon(true);
        diyThread.start();

        System.out.println("Main thread over!");
    }
}
